package com.briup.cms.service.impl;

import com.briup.cms.bean.Article;
import com.briup.cms.bean.extend.ArticleExtend;
import com.briup.cms.dao.ArticleMapper;
import com.briup.cms.dao.extend.ArticleExtendMapper;
import com.briup.cms.exception.CustomerException;
import com.briup.cms.service.IArticleService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 资讯信息服务层
 */
@Service
public class ArticleServiceImpl implements IArticleService {
    @Autowired
    private ArticleMapper articleMapper;
    @Autowired
    private ArticleExtendMapper articleExtendMapper;


    // 通过id查询咨询信息，同时获取咨询对应的栏目和用户信息
    @Override
    public ArticleExtend findByIdWithCategoryAndUser(int id) {

        return null;
    }

    // 保存或更新咨询信息
    @Transactional
    @Override
    public void saveOrUpdate(Article article) throws CustomerException {

    }

    // 分页查询咨询信息，同时获取咨询对应的栏目和用户信息
    @Override
    public PageInfo<ArticleExtend> pageQueryArticleWithCategoryAndUser(int pageNum, int pageSize,String title,Integer status,Integer categoryId) throws CustomerException {

        return null;
    }

    // 通过id删除咨询信息
    @Transactional
    @Override
	public void deleteById(int id) throws CustomerException {

	}

    // 分页查询推荐被推荐的咨询信息，同时获取咨询对应的栏目和用户信息
	@Override
	public PageInfo<ArticleExtend> pageQueryRecommend(int pageNum, int pageSize) {

		return null;
	}

    // 修改咨询信息的状态，状态：0-待审核，1-不通过，2-通过，3-推荐
	@Transactional
	@Override
	public void changeStatus(int id, int status) throws CustomerException {

	}
}
